{extend name="common/base" /}

{block name="body"}

<div class="zuce-mains">
    <div class="zuce-img"><img src="__CDN__/html/img/login_logo.png"></div>
    <div class="zuce-list">
        <div class="list-input list-input2">
            <img src="__CDN__/html/img/login_phone.png" class="phone-img">
            <input type="text" name="account" placeholder="请输入11位手机号码" class="phone-input js-phone">
        </div> 
        <div class="list-input">
            <img src="__CDN__/html/img/login_password.png" class="phone-img phone-img2">
            <input type="password" id="password" name="password" data-rule="required;password" placeholder="请输入密码" class="phone-input js-password">
        </div>                              
    </div>
    <div class="zc-button js-login">登录</div>
    <div class="dr-list">
        <span><a href="{:url('Pub/register')}">立即注册</a></span>
        <span class="span1"><a href="{:url('Pub/repassword')}">忘记密码</a></span>
    </div>
</div>
{/block}
{block name="menu"}{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        $('.js-login').on('click', function () {
            var phone = $('.js-phone').val();
            var password = $('.js-password').val();
            var backurl = $('.js-back-url').val();
            if (!is_mobile(phone)) {
                mui.alert('请填写正确格式手机号');
                return false;
            }
            if (!password) {
                mui.alert('请填写密码');
                return false;
            }
            $.post("{:url('Pub/login')}", {phone: phone, password: password, backurl: backurl}, function (res) {
                if (res.code == '1') {
                    location.href = res.url;
                } else {
                    mui.toast(res.msg);
                }
            }, 'json');

        });
    });
</script>
{/block}